export default function debounce(fn,wait) {
  let timer = null;
  return function() {
    const _this = this
    const arg = arguments
    if(timer !== null){
      clearTimeout(timer)
    }
    timer = setTimeout(() => {
      fn.apply(_this,arg)
    },wait);
  }
}